package models

import "time"

type GogsStruct struct {
	Ref        string       `json:"ref"`
	Before     string       `json:"before"`
	After      string       `json:"after"`
	ConpareUrl string       `json:"compare_url"`
	Commits    []GogsCommit `json:"commits"`
	Repository GogsRepo     `json:"repository"`
	Pusher     GogsUser     `json:"pusher"`
	Sender     GogsUser     `json:"sender"`
}

type GogsCommit struct {
	Id        string        `json:"id"`
	Message   string        `json:"message"`
	Url       string        `json:"url"`
	Author    GogsShortUser `json:"author"`
	Commiter  GogsShortUser `json:"committer"`
	Timestamp time.Time     `json:"timestamp"`
}

type GogsShortUser struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Username string `json:"username"`
}

type GogsUser struct {
	Login     string `json:"login"`
	FullName  string `json:"full_name"`
	Email     string `json:"email"`
	AvatarUrl string `json:"avatar_url"`
	UserName  string `json:"username"`
}

type GogsRepo struct {
	Id            int       `json:"id"`
	Owner         GogsUser  `json:"owner"`
	Name          string    `json:"name"`
	FullName      string    `json:"full_name"`
	Description   string    `json:"description"`
	Private       bool      `json:"private"`
	Fork          bool      `json:"fork"`
	HtmlUrl       string    `json:"html_url"`
	SshUrl        string    `json:"ssh_url"`
	CloneUrl      string    `json:"clone_url"`
	Website       string    `json:"website"`
	Stars         int       `json:"stars_count"`
	Forks         int       `json:"forks_count"`
	Watchers      int       `json:"watchers_count"`
	Issues        int       `json:"open_issues_count"`
	DefaultBranch string    `json:"default_branch"`
	CreateAt      time.Time `json:"create_at"`
	UpdateAt      time.Time `json:"updated_at"`
}

type FeishuStruct struct {
	MsgType string                              `json:"msg_type"`
	Content map[string]map[string]FeishuContent `json:"content"`
}

type FeishuContent struct {
	Title   string        `json:"title"`
	Content [][]FeishuTag `json:"content"`
}

type FeishuTag struct {
	Tag  string `json:"tag"`
	Text string `json:"text"`
	Href string `json:"href"`
}
